import request from '/src/utils/request.js';
import {useTokenStore} from "@/stores/token.js";

//文章分类列表查询
export const articleCategoryListService = () => {
  // const tokenStore = useTokenStore()
  // return request.get("/category/list", {
  //   headers: {
  //     Authorization: tokenStore.token
  //   }
  // });
  return request.get("/category/list")
};

//文章分类添加函数
export const articleCategoryAddService = (categoryData) => {
  return request.post('/category/add', categoryData)
}

//文章分类修改函数
export const articleCategoryUpdateService = (categoryData) => {
  return request.put('/category/update', categoryData)
}

//文章分类删除函数
export const articleCategoryDeleteService = (id) => {
  console.log("======categoryId=========")
  return request.delete('/category/delete?id='+id)
}